
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>4-1 python3小白课：if分支结构 · python3小白课笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="雪山凌狐">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-material-light.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-auto-scroll-table/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-ad/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-image-captions/image-captions.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../css/website.css">
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="4-2 python3小白课：while循环结构.html" />
    
    
    <link rel="prev" href="./" />
    

    
        <link rel="shortcut icon" href='../assets/favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../assets/favicon.ico' type="image/x-icon">
    
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://fox-9.com" target="_blank" class="custom-link">雪山凌狐教程</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Python3小白课 介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Catalog.html">
            
                <a href="../Catalog.html">
            
                    
                    课程目录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter1/">
            
                <a href="../chapter1/">
            
                    
                    一、Python初识
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter1/1-1 python3小白课：python语言简介.html">
            
                <a href="../chapter1/1-1 python3小白课：python语言简介.html">
            
                    
                    1-1 python3小白课：python语言简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter1/1-2 python3小白课：python下载.html">
            
                <a href="../chapter1/1-2 python3小白课：python下载.html">
            
                    
                    1-2 python3小白课：python下载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter1/1-3 python3小白课：python安装.html">
            
                <a href="../chapter1/1-3 python3小白课：python安装.html">
            
                    
                    1-3 python3小白课：python安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter1/1-4 python3小白课：我的第一个python脚本.html">
            
                <a href="../chapter1/1-4 python3小白课：我的第一个python脚本.html">
            
                    
                    1-4 python3小白课：我的第一个python脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../chapter1/1-5 python3小白课：如何运行py文件.html">
            
                <a href="../chapter1/1-5 python3小白课：如何运行py文件.html">
            
                    
                    1-5 python3小白课：如何运行py文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../chapter1/1-6 python3小白课：使用python IDLE.html">
            
                <a href="../chapter1/1-6 python3小白课：使用python IDLE.html">
            
                    
                    1-6 python3小白课：使用python IDLE
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../chapter1/1-7 python3小白课：使用python shell.html">
            
                <a href="../chapter1/1-7 python3小白课：使用python shell.html">
            
                    
                    1-7 python3小白课：使用python shell
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../chapter2/">
            
                <a href="../chapter2/">
            
                    
                    二、变量、简单类型和运算符
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../chapter2/2-1 python3小白课：啥是变量.html">
            
                <a href="../chapter2/2-1 python3小白课：啥是变量.html">
            
                    
                    2-1 python3小白课：啥是变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../chapter2/2-2 python3小白课：定义常量.html">
            
                <a href="../chapter2/2-2 python3小白课：定义常量.html">
            
                    
                    2-2 python3小白课：定义常量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../chapter2/2-3 python3小白课：注释让你事半功倍.html">
            
                <a href="../chapter2/2-3 python3小白课：注释让你事半功倍.html">
            
                    
                    2-3 python3小白课：注释让你事半功倍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../chapter2/2-4 python3小白课：数值类型之整型.html">
            
                <a href="../chapter2/2-4 python3小白课：数值类型之整型.html">
            
                    
                    2-4 python3小白课：数值类型之整型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../chapter2/2-5 python3小白课：数值类型之浮点型.html">
            
                <a href="../chapter2/2-5 python3小白课：数值类型之浮点型.html">
            
                    
                    2-5 python3小白课：数值类型之浮点型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../chapter2/2-6 python3小白课：数值类型之复数.html">
            
                <a href="../chapter2/2-6 python3小白课：数值类型之复数.html">
            
                    
                    2-6 python3小白课：数值类型之复数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../chapter2/2-7 python3小白课：字符串入门.html">
            
                <a href="../chapter2/2-7 python3小白课：字符串入门.html">
            
                    
                    2-7 python3小白课：字符串入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="../chapter2/2-8 python3小白课：字节串.html">
            
                <a href="../chapter2/2-8 python3小白课：字节串.html">
            
                    
                    2-8 python3小白课：字节串
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="../chapter2/2-9 python3小白课：字符串进阶.html">
            
                <a href="../chapter2/2-9 python3小白课：字符串进阶.html">
            
                    
                    2-9 python3小白课：字符串进阶
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="../chapter2/2-10 python3小白课：赋值运算符.html">
            
                <a href="../chapter2/2-10 python3小白课：赋值运算符.html">
            
                    
                    2-10 python3小白课：赋值运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.11" data-path="../chapter2/2-11 python3小白课：算术运算符.html">
            
                <a href="../chapter2/2-11 python3小白课：算术运算符.html">
            
                    
                    2-11 python3小白课：算术运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.12" data-path="../chapter2/2-12 python3小白课：索引运算符.html">
            
                <a href="../chapter2/2-12 python3小白课：索引运算符.html">
            
                    
                    2-12 python3小白课：索引运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.13" data-path="../chapter2/2-13 python3小白课：比较运算符.html">
            
                <a href="../chapter2/2-13 python3小白课：比较运算符.html">
            
                    
                    2-13 python3小白课：比较运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.14" data-path="../chapter2/2-14 python3小白课：身份运算符.html">
            
                <a href="../chapter2/2-14 python3小白课：身份运算符.html">
            
                    
                    2-14 python3小白课：身份运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.15" data-path="../chapter2/2-15 python3小白课：逻辑运算符.html">
            
                <a href="../chapter2/2-15 python3小白课：逻辑运算符.html">
            
                    
                    2-15 python3小白课：逻辑运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.16" data-path="../chapter2/2-16 python3小白课：位运算符.html">
            
                <a href="../chapter2/2-16 python3小白课：位运算符.html">
            
                    
                    2-16 python3小白课：位运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.17" data-path="../chapter2/2-17 python3小白课：赋值运算符扩展.html">
            
                <a href="../chapter2/2-17 python3小白课：赋值运算符扩展.html">
            
                    
                    2-17 python3小白课：赋值运算符扩展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.18" data-path="../chapter2/2-18 python3小白课：三目运算符.html">
            
                <a href="../chapter2/2-18 python3小白课：三目运算符.html">
            
                    
                    2-18 python3小白课：三目运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.19" data-path="../chapter2/2-19 python3小白课：成员运算符.html">
            
                <a href="../chapter2/2-19 python3小白课：成员运算符.html">
            
                    
                    2-19 python3小白课：成员运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.20" data-path="../chapter2/2-20 python3小白课：运算符优先级.html">
            
                <a href="../chapter2/2-20 python3小白课：运算符优先级.html">
            
                    
                    2-20 python3小白课：运算符优先级
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter3/">
            
                <a href="../chapter3/">
            
                    
                    三、列表、元组和字典
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter3/3-1 python3小白课：列表和元组的区别.html">
            
                <a href="../chapter3/3-1 python3小白课：列表和元组的区别.html">
            
                    
                    3-1 python3小白课：列表和元组的区别
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter3/3-2 python3小白课：列表元组入门.html">
            
                <a href="../chapter3/3-2 python3小白课：列表元组入门.html">
            
                    
                    3-2 python3小白课：列表元组入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../chapter3/3-3 python3小白课：深入列表.html">
            
                <a href="../chapter3/3-3 python3小白课：深入列表.html">
            
                    
                    3-3 python3小白课：深入列表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../chapter3/3-4 python3小白课：字典初识.html">
            
                <a href="../chapter3/3-4 python3小白课：字典初识.html">
            
                    
                    3-4 python3小白课：字典初识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../chapter3/3-5 python3小白课：字典操作基础.html">
            
                <a href="../chapter3/3-5 python3小白课：字典操作基础.html">
            
                    
                    3-5 python3小白课：字典操作基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../chapter3/3-6 python3小白课：字典的常用方法.html">
            
                <a href="../chapter3/3-6 python3小白课：字典的常用方法.html">
            
                    
                    3-6 python3小白课：字典的常用方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="./">
            
                <a href="./">
            
                    
                    四、流程控制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.6.1" data-path="4-1 python3小白课：if分支结构.html">
            
                <a href="4-1 python3小白课：if分支结构.html">
            
                    
                    4-1 python3小白课：if分支结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="4-2 python3小白课：while循环结构.html">
            
                <a href="4-2 python3小白课：while循环结构.html">
            
                    
                    4-2 python3小白课：while循环结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="4-3 python3小白课：for-in循环结构.html">
            
                <a href="4-3 python3小白课：for-in循环结构.html">
            
                    
                    4-3 python3小白课：for-in循环结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="4-4 python3小白课：for表达式.html">
            
                <a href="4-4 python3小白课：for表达式.html">
            
                    
                    4-4 python3小白课：for表达式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../chapter5/">
            
                <a href="../chapter5/">
            
                    
                    五、自定义函数
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../chapter5/5-1 python3小白课：函数是什么.html">
            
                <a href="../chapter5/5-1 python3小白课：函数是什么.html">
            
                    
                    5-1 python3小白课：函数是什么
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../chapter5/5-2 python3小白课：函数入门.html">
            
                <a href="../chapter5/5-2 python3小白课：函数入门.html">
            
                    
                    5-2 python3小白课：函数入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../chapter5/5-3 python3小白课：递归函数.html">
            
                <a href="../chapter5/5-3 python3小白课：递归函数.html">
            
                    
                    5-3 python3小白课：递归函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../chapter5/5-4 python3小白课：关键字参数.html">
            
                <a href="../chapter5/5-4 python3小白课：关键字参数.html">
            
                    
                    5-4 python3小白课：关键字参数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../chapter5/5-5 python3小白课：参数默认值.html">
            
                <a href="../chapter5/5-5 python3小白课：参数默认值.html">
            
                    
                    5-5 python3小白课：参数默认值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../chapter5/5-6 python3小白课：参数收集.html">
            
                <a href="../chapter5/5-6 python3小白课：参数收集.html">
            
                    
                    5-6 python3小白课：参数收集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="../chapter5/5-7 python3小白课：变量作用域.html">
            
                <a href="../chapter5/5-7 python3小白课：变量作用域.html">
            
                    
                    5-7 python3小白课：变量作用域
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="../chapter5/5-8 python3小白课：局部函数.html">
            
                <a href="../chapter5/5-8 python3小白课：局部函数.html">
            
                    
                    5-8 python3小白课：局部函数
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../chapter6/">
            
                <a href="../chapter6/">
            
                    
                    六、模块和包
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../chapter6/6-1 python3小白课：模块的导入.html">
            
                <a href="../chapter6/6-1 python3小白课：模块的导入.html">
            
                    
                    6-1 python3小白课：模块的导入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../chapter6/6-2 python3小白课：自己写模块.html">
            
                <a href="../chapter6/6-2 python3小白课：自己写模块.html">
            
                    
                    6-2 python3小白课：自己写模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../chapter6/6-3 python3小白课：导入模块详解.html">
            
                <a href="../chapter6/6-3 python3小白课：导入模块详解.html">
            
                    
                    6-3 python3小白课：导入模块详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../chapter6/6-4 python3小白课：包是什么.html">
            
                <a href="../chapter6/6-4 python3小白课：包是什么.html">
            
                    
                    6-4 python3小白课：包是什么
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../chapter6/6-5 python3小白课：定义包.html">
            
                <a href="../chapter6/6-5 python3小白课：定义包.html">
            
                    
                    6-5 python3小白课：定义包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../chapter6/6-6 python3小白课：包成员导入.html">
            
                <a href="../chapter6/6-6 python3小白课：包成员导入.html">
            
                    
                    6-6 python3小白课：包成员导入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../chapter6/6-7 python3小白课：模块内容查看.html">
            
                <a href="../chapter6/6-7 python3小白课：模块内容查看.html">
            
                    
                    6-7 python3小白课：模块内容查看
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../chapter6/6-8 python3小白课：解锁你心仪的三方包.html">
            
                <a href="../chapter6/6-8 python3小白课：解锁你心仪的三方包.html">
            
                    
                    6-8 python3小白课：解锁你心仪的三方包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="../chapter6/6-9 python3小白课：虚拟环境介绍和安装.html">
            
                <a href="../chapter6/6-9 python3小白课：虚拟环境介绍和安装.html">
            
                    
                    6-9 python3小白课：虚拟环境介绍和安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="../chapter6/6-10 python3小白课：虚拟环境使用.html">
            
                <a href="../chapter6/6-10 python3小白课：虚拟环境使用.html">
            
                    
                    6-10 python3小白课：虚拟环境使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../chapter7/">
            
                <a href="../chapter7/">
            
                    
                    七、类和对象
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../chapter7/7-1 python3小白课：一节课搞懂面向对象.html">
            
                <a href="../chapter7/7-1 python3小白课：一节课搞懂面向对象.html">
            
                    
                    7-1 python3小白课：一节课搞懂面向对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../chapter7/7-2 python3小白课：定义类和实例化对象.html">
            
                <a href="../chapter7/7-2 python3小白课：定义类和实例化对象.html">
            
                    
                    7-2 python3小白课：定义类和实例化对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../chapter7/7-3 python3小白课：了解实例方法.html">
            
                <a href="../chapter7/7-3 python3小白课：了解实例方法.html">
            
                    
                    7-3 python3小白课：了解实例方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../chapter7/7-4 python3小白课：用property函数定义属性.html">
            
                <a href="../chapter7/7-4 python3小白课：用property函数定义属性.html">
            
                    
                    7-4 python3小白课：用property函数定义属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../chapter7/7-5 python3小白课：封装和隐藏.html">
            
                <a href="../chapter7/7-5 python3小白课：封装和隐藏.html">
            
                    
                    7-5 python3小白课：封装和隐藏
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.6" data-path="../chapter7/7-6 python3小白课：类的继承和多继承.html">
            
                <a href="../chapter7/7-6 python3小白课：类的继承和多继承.html">
            
                    
                    7-6 python3小白课：类的继承和多继承
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.7" data-path="../chapter7/7-7 python3小白课：重写父类方法和使用super函数.html">
            
                <a href="../chapter7/7-7 python3小白课：重写父类方法和使用super函数.html">
            
                    
                    7-7 python3小白课：重写父类方法和使用super函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.8" data-path="../chapter7/7-8 python3小白课：类的多态性.html">
            
                <a href="../chapter7/7-8 python3小白课：类的多态性.html">
            
                    
                    7-8 python3小白课：类的多态性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.9" data-path="../chapter7/7-9 python3小白课：可以被枚举的类.html">
            
                <a href="../chapter7/7-9 python3小白课：可以被枚举的类.html">
            
                    
                    7-9 python3小白课：可以被枚举的类
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../chapter8/">
            
                <a href="../chapter8/">
            
                    
                    八、异常处理机制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../chapter8/8-1 python3小白课：最基本的异常处理.html">
            
                <a href="../chapter8/8-1 python3小白课：最基本的异常处理.html">
            
                    
                    8-1 python3小白课：最基本的异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../chapter8/8-2 python3小白课：多异常捕获.html">
            
                <a href="../chapter8/8-2 python3小白课：多异常捕获.html">
            
                    
                    8-2 python3小白课：多异常捕获
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../chapter8/8-3 python3小白课：查看详细异常信息.html">
            
                <a href="../chapter8/8-3 python3小白课：查看详细异常信息.html">
            
                    
                    8-3 python3小白课：查看详细异常信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../chapter8/8-4 python3小白课：异常机制中的else块.html">
            
                <a href="../chapter8/8-4 python3小白课：异常机制中的else块.html">
            
                    
                    8-4 python3小白课：异常机制中的else块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../chapter8/8-5 python3小白课：finally块回收资源.html">
            
                <a href="../chapter8/8-5 python3小白课：finally块回收资源.html">
            
                    
                    8-5 python3小白课：finally块回收资源
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.6" data-path="../chapter8/8-6 python3小白课：自己引发异常.html">
            
                <a href="../chapter8/8-6 python3小白课：自己引发异常.html">
            
                    
                    8-6 python3小白课：自己引发异常
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../Summary.html">
            
                <a href="../Summary.html">
            
                    
                    课程总结
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >4-1 python3小白课：if分支结构</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <html><head></head><body><div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon fa fa-hand-o-right"></span><a href="#python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;if&#x5206;&#x652F;&#x7ED3;&#x6784;"><b></b>python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;if&#x5206;&#x652F;&#x7ED3;&#x6784;</a></li><ul><ul><li><span class="title-icon fa fa-hand-o-right"></span><a href="#&#x987A;&#x5E8F;&#x7ED3;&#x6784;"><b></b>&#x987A;&#x5E8F;&#x7ED3;&#x6784;</a></li><li><span class="title-icon fa fa-hand-o-right"></span><a href="#if&#x5206;&#x652F;&#x7ED3;&#x6784;"><b></b>if&#x5206;&#x652F;&#x7ED3;&#x6784;</a></li><li><span class="title-icon fa fa-hand-o-right"></span><a href="#if&#x7ED3;&#x6784;&#x7684;&#x5224;&#x65AD;&#x6761;&#x4EF6;"><b></b>if&#x7ED3;&#x6784;&#x7684;&#x5224;&#x65AD;&#x6761;&#x4EF6;</a></li><li><span class="title-icon fa fa-hand-o-right"></span><a href="#if&#x5206;&#x652F;&#x7684;&#x903B;&#x8F91;&#x9519;&#x8BEF;"><b></b>if&#x5206;&#x652F;&#x7684;&#x903B;&#x8F91;&#x9519;&#x8BEF;</a></li><li><span class="title-icon fa fa-hand-o-right"></span><a href="#if&#x8868;&#x8FBE;&#x5F0F;"><b></b>if&#x8868;&#x8FBE;&#x5F0F;</a></li><li><span class="title-icon fa fa-hand-o-right"></span><a href="#pass&#x5360;&#x4F4D;&#x7B26;"><b></b>pass&#x5360;&#x4F4D;&#x7B26;</a></li><li><span class="title-icon fa fa-hand-o-right"></span><a href="#&#x5355;&#x8BCD;&#x91CA;&#x4E49;"><b></b>&#x5355;&#x8BCD;&#x91CA;&#x4E49;</a></li></ul></ul></ul></div><h1 id="python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;if&#x5206;&#x652F;&#x7ED3;&#x6784;"><a name="python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;if&#x5206;&#x652F;&#x7ED3;&#x6784;" class="anchor-navigation-ex-anchor" href="#python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;if&#x5206;&#x652F;&#x7ED3;&#x6784;"><i class="fa fa-link" aria-hidden="true"></i></a>python3&#x5C0F;&#x767D;&#x8BFE;&#xFF1A;if&#x5206;&#x652F;&#x7ED3;&#x6784;</h1>
<h3 id="&#x987A;&#x5E8F;&#x7ED3;&#x6784;"><a name="&#x987A;&#x5E8F;&#x7ED3;&#x6784;" class="anchor-navigation-ex-anchor" href="#&#x987A;&#x5E8F;&#x7ED3;&#x6784;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x987A;&#x5E8F;&#x7ED3;&#x6784;</h3>
<p>&#x5F53;&#x6211;&#x4EEC;&#x6CA1;&#x6709;&#x6307;&#x5B9A;&#x4EE3;&#x7801;&#x8FD0;&#x884C;&#x7ED3;&#x6784;&#x7684;&#x65F6;&#x5019;&#xFF0C;python&#x662F;&#x4E00;&#x6761;&#x8DEF;&#x8D70;&#x5230;&#x9ED1;&#x7684;&#xFF0C;&#x5373;&#x4ECE;&#x4E0A;&#x5F80;&#x4E0B;&#x4E00;&#x884C;&#x884C;&#x89E3;&#x6790;&#x6267;&#x884C;&#x4EE3;&#x7801;&#xFF0C;&#x6392;&#x5728;&#x524D;&#x9762;&#x7684;&#x5148;&#x6267;&#x884C;&#xFF0C;&#x6392;&#x5728;&#x540E;&#x9762;&#x7684;&#x540E;&#x6267;&#x884C;&#x3002;</p>
<p>&#x4F46;&#x6211;&#x4EEC;&#x7684;&#x4E16;&#x754C;&#x90FD;&#x662F;&#x4E00;&#x6761;&#x8DEF;&#x8D70;&#x5230;&#x9ED1;&#x7684;&#x5417;&#xFF1F;</p>
<p>&#x6BD4;&#x5982;&#x5C0F;&#x767D;&#x540C;&#x5B66;&#x5F88;&#x4E0D;&#x559C;&#x6B22;&#x4E0B;&#x96E8;&#xFF0C;&#x4E00;&#x4E0B;&#x96E8;&#x5C31;&#x4E0D;&#x60F3;&#x51FA;&#x95E8;&#xFF0C;&#x90A3;&#x4E48;&#x5C0F;&#x767D;&#x540C;&#x5B66;&#x4F1A;&#x8FD9;&#x4E48;&#x60F3;&#xFF1A;&#x51FA;&#x95E8;&#x524D;&#x770B;&#x770B;&#x5916;&#x9762;&#x7684;&#x5929;&#x6C14;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x5927;&#x6674;&#x5929;&#xFF0C;&#x5C31;&#x51FA;&#x95E8;&#xFF0C;&#x5982;&#x679C;&#x4E0B;&#x96E8;&#xFF0C;&#x5C31;&#x4E0D;&#x51FA;&#x95E8;&#x3002;</p>
<p>&#x8FD9;&#x6837;&#x7684;&#x9700;&#x6C42;&#x987A;&#x5E8F;&#x7ED3;&#x6784;&#x5C31;&#x65E0;&#x6CD5;&#x89E3;&#x51B3;&#x3002;&#x8FD9;&#x65F6;&#x5019;&#x6211;&#x4EEC;&#x5C31;&#x9700;&#x8981;&#x7528;&#x5230;if&#x5206;&#x652F;&#x7ED3;&#x6784;&#x4E86;&#x3002;</p>
<hr>
<h3 id="if&#x5206;&#x652F;&#x7ED3;&#x6784;"><a name="if&#x5206;&#x652F;&#x7ED3;&#x6784;" class="anchor-navigation-ex-anchor" href="#if&#x5206;&#x652F;&#x7ED3;&#x6784;"><i class="fa fa-link" aria-hidden="true"></i></a>if&#x5206;&#x652F;&#x7ED3;&#x6784;</h3>
<p>if&#x662F;&#x5982;&#x679C;&#x7684;&#x610F;&#x601D;&#xFF0C;&#x90A3;&#x4E48;&#x5B83;&#x5C31;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x63A7;&#x5236;&#x6211;&#x4EEC;&#x7684;&#x5224;&#x65AD;&#x6761;&#x4EF6;&#x8BA9;&#x7A0B;&#x5E8F;&#x5224;&#x65AD;&#x4E00;&#x4E0B;&#xFF0C;if&#x8BED;&#x53E5;&#x6709;&#x51E0;&#x79CD;&#x5199;&#x6CD5;&#x5F62;&#x5F0F;&#xFF0C;&#x7167;&#x7740;&#x5C0F;&#x767D;&#x540C;&#x5B66;&#x7684;&#x4F8B;&#x5B50;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5199;&#x4E0B;&#x5982;&#x4E0B;&#x7684;&#x4F2A;&#x4EE3;&#x7801;&#x65B9;&#x4FBF;&#x5927;&#x5BB6;&#x7406;&#x89E3;&#xFF08;&#x6CE8;&#x610F;&#x4E0D;&#x662F;&#x771F;&#x6B63;&#x7684;python&#x4EE3;&#x7801;&#xFF09;&#xFF1A;</p>
<pre class="language-"><code class="lang-python"><span class="token comment"># coding:utf-8</span>
<span class="token comment"># &#x5199;&#x6CD5;1</span>
<span class="token keyword">if</span> <span class="token string">&quot;&#x5916;&#x9762;&#x5927;&#x6674;&#x5929;&quot;</span><span class="token punctuation">:</span>
    <span class="token string">&quot;&#x51FA;&#x95E8;&#x54AF;~&quot;</span>

<span class="token comment"># &#x5199;&#x6CD5;2&#xFF0C;else&#x8868;&#x793A;&#x5426;&#x5219;&#xFF0C;&#x540E;&#x9762;&#x4E0D;&#x9700;&#x8981;&#x8DDF;&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;&#xFF0C;&#x56CA;&#x62EC;&#x6240;&#x6709;&#x5176;&#x4ED6;&#x7684;&#x53EF;&#x80FD;&#x6027;</span>
<span class="token keyword">if</span> <span class="token string">&quot;&#x5916;&#x9762;&#x5927;&#x6674;&#x5929;&quot;</span><span class="token punctuation">:</span>
    <span class="token string">&quot;&#x51FA;&#x95E8;&#x54AF;~&quot;</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token string">&quot;&#x575A;&#x51B3;&#x4E0D;&#x51FA;&#x95E8;&quot;</span>

<span class="token comment"># &#x5199;&#x6CD5;3&#xFF0C;elif&#x4E3A;else if&#x5355;&#x8BCD;&#x7684;&#x5408;&#x5E76;&#xFF0C;&#x8868;&#x793A;&#x5426;&#x5219;&#x5982;&#x679C;&#xFF0C;&#x540E;&#x9762;&#x9700;&#x8981;&#x8DDF;&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;&#x3002;&#x5141;&#x8BB8;&#x6709;&#x591A;&#x4E2A;elif</span>
<span class="token keyword">if</span> <span class="token string">&quot;&#x5916;&#x9762;&#x5927;&#x6674;&#x5929;&quot;</span><span class="token punctuation">:</span>
    <span class="token string">&quot;&#x51FA;&#x95E8;&#x54AF;~&quot;</span>
<span class="token keyword">elif</span> <span class="token string">&quot;&#x5916;&#x9762;&#x5927;&#x66B4;&#x96E8;&quot;</span><span class="token punctuation">:</span>
    <span class="token string">&quot;&#x575A;&#x51B3;&#x4E0D;&#x51FA;&#x95E8;&quot;</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token string">&quot;&#x770B;&#x770B;&#x60C5;&#x51B5;&#x518D;&#x8BF4;&quot;</span>
</code></pre>
<p>&#x901A;&#x8FC7;&#x4E0A;&#x8FF0;&#x4F2A;&#x4EE3;&#x7801;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x53EF;&#x4EE5;&#x6E05;&#x6670;&#x7684;&#x770B;&#x5230;if&#x5206;&#x652F;&#x7ED3;&#x6784;&#x7684;&#x591A;&#x79CD;&#x5224;&#x65AD;&#x6761;&#x4EF6;&#x7684;&#x5199;&#x6CD5;&#x65B9;&#x5F0F;&#x4EE5;&#x53CA;&#x5BF9;&#x5E94;&#x600E;&#x4E48;&#x6267;&#x884C;&#xFF0C;&#x5206;&#x6790;&#x4E0A;&#x8FF0;&#x4EE3;&#x7801;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x603B;&#x7ED3;&#x51FA;if&#x7ED3;&#x6784;&#x6709;&#x5982;&#x4E0B;&#x51E0;&#x4E2A;&#x5199;&#x6CD5;&#x6CE8;&#x610F;&#x70B9;&#xFF1A;</p>
<ul>
<li><p>if&#x5206;&#x652F;&#x7ED3;&#x6784;&#x4EE5;if&#x5F00;&#x5934;&#xFF0C;&#x540E;&#x9762;&#x8DDF;&#x968F;&#x5224;&#x65AD;&#x7684;&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;&#xFF0C;&#x5982;&#x679C;&#x8868;&#x8FBE;&#x5F0F;&#x7ED3;&#x679C;&#x8FD4;&#x56DE;True&#xFF0C;&#x5219;&#x6267;&#x884C;if&#x533A;&#x6BB5;&#x4E0B;&#x9762;&#x7684;&#x8BED;&#x53E5;&#xFF0C;&#x5982;&#x679C;&#x4E3A;False&#xFF0C;&#x5219;&#x4E0D;&#x6267;&#x884C;&#x4F1A;&#x5F80;&#x4E0B;&#x770B;</p>
</li>
<li><p>&#x63A5;&#x4E0B;&#x6765;&#x5982;&#x679C;&#x6709;elif&#x8BED;&#x53E5;&#xFF0C;&#x4F1A;&#x7EE7;&#x7EED;&#x5224;&#x65AD;&#x662F;&#x5426;&#x7B26;&#x5408;&#x6761;&#x4EF6;&#xFF0C;&#x5982;&#x679C;&#x4E3A;True&#xFF0C;&#x5219;&#x6267;&#x884C;elif&#x4E0B;&#x9762;&#x7684;&#x8BED;&#x53E5;&#xFF0C;&#x5426;&#x5219;&#x7EE7;&#x7EED;&#x5F80;&#x4E0B;</p>
</li>
<li><p>&#x5F53;&#x4E0B;&#x9762;&#x518D;&#x6CA1;&#x6709;elif&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5982;&#x679C;&#x6CA1;&#x6709;else&#x8BED;&#x53E5;&#xFF0C;&#x5219;&#x5206;&#x652F;&#x8FD0;&#x884C;&#x7ED3;&#x675F;&#xFF0C;&#x4F46;&#x5982;&#x679C;&#x6709;else&#x8BED;&#x53E5;&#xFF0C;&#x5219;&#x76F4;&#x63A5;&#x8FD0;&#x884C;else&#x8BED;&#x53E5;&#x4E0B;&#x9762;&#x5B9A;&#x4E49;&#x7684;python&#x8BED;&#x53E5;</p>
</li>
<li><p>&#x9700;&#x8981;&#x6CE8;&#x610F;&#xFF0C;&#x6BCF;&#x4E2A;&#x7ED3;&#x6784;&#x5199;&#x5B8C;&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;&#x4E4B;&#x540E;&#x7684;&#x5192;&#x53F7;<code>:</code>&#xFF0C;&#x4E0D;&#x8981;&#x6F0F;&#x6389;&#x4E86;</p>
</li>
<li><p>&#x7ED3;&#x6784;&#x4E0B;&#x7684;&#x53EF;&#x6267;&#x884C;&#x8BED;&#x53E5;&#xFF0C;&#x5927;&#x5BB6;&#x5E94;&#x8BE5;&#x5F88;&#x5BB9;&#x6613;&#x6CE8;&#x610F;&#x5230;&#x6211;&#x90FD;&#x662F;&#x7528;&#x4E86;&#x7F29;&#x8FDB;&#x7684;&#xFF0C;&#x8FD9;&#x662F;python&#x7F16;&#x7A0B;&#x8BED;&#x8A00;&#x76F8;&#x6BD4;&#x5176;&#x4ED6;&#x7F16;&#x7A0B;&#x8BED;&#x8A00;&#x7684;&#x4E00;&#x5927;&#x7279;&#x8272;&#xFF08;&#x5176;&#x4ED6;&#x7F16;&#x7A0B;&#x8BED;&#x8A00;&#x53EF;&#x80FD;&#x7528;&#x82B1;&#x62EC;&#x53F7;<code>{}</code>&#x6216;&#x8005;<code>end</code>&#x7B49;&#x5173;&#x952E;&#x5B57;&#x6765;&#x8868;&#x793A;&#x6D41;&#x7A0B;&#x63A7;&#x5236;&#x533A;&#x6BB5;&#x8303;&#x56F4;&#xFF09;&#xFF0C;python&#x5F3A;&#x5236;&#x8FD9;&#x4E9B;&#x6D41;&#x7A0B;&#x63A7;&#x5236;&#x7ED3;&#x6784;&#x90FD;&#x9700;&#x8981;&#x91C7;&#x7528;&#x7F29;&#x8FDB;&#x7684;&#x65B9;&#x5F0F;&#x6765;&#x8868;&#x8FBE;&#x5C42;&#x7EA7;&#x5173;&#x7CFB;&#xFF0C;&#x6BD4;&#x5982;<code>&quot;&#x51FA;&#x95E8;&#x54AF;~&quot;</code>&#x662F;&#x7F29;&#x8FDB;&#x7684;&#xFF0C;&#x5C31;&#x8868;&#x793A;&#x5B83;&#x662F;if&#x8BED;&#x53E5;&#x5757;&#x4E0B;&#x9762;&#x8981;&#x6267;&#x884C;&#x7684;&#x5206;&#x652F;&#x4EE3;&#x7801;&#xFF0C;&#x8FD9;&#x6837;&#x5B9A;&#x4E49;&#x7684;&#x597D;&#x5904;&#x662F;&#xFF0C;&#x9047;&#x5230;&#x6D41;&#x7A0B;&#x63A7;&#x5236;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x901A;&#x8FC7;&#x7F29;&#x8FDB;&#x5C31;&#x53EF;&#x4EE5;&#x5F88;&#x5BB9;&#x6613;&#x533A;&#x5206;&#x90A3;&#x4E9B;&#x662F;&#x6D41;&#x7A0B;&#x63A7;&#x5236;&#x8BED;&#x53E5;&#x5757;&#x4E0B;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x5BF9;&#x4E8E;&#x5F3A;&#x8FEB;&#x75C7;&#x60A3;&#x8005;&#x6765;&#x8BF4;&#x8FD9;&#x662F;&#x76F8;&#x5F53;&#x7F8E;&#x89C2;&#x7684;&#x3002;&#x4F46;&#x5B83;&#x7684;&#x4E0D;&#x8DB3;&#x4E4B;&#x5904;&#x4E5F;&#x5F88;&#x660E;&#x663E;&#xFF0C;&#x90A3;&#x5C31;&#x662F;&#x4EE3;&#x7801;&#x7F16;&#x5199;&#x65F6;&#x9700;&#x8981;&#x7279;&#x522B;&#x6CE8;&#x610F;&#x7F29;&#x8FDB;&#xFF0C;&#x5982;&#x679C;&#x8BE5;&#x7F29;&#x8FDB;&#x5374;&#x6CA1;&#x7F29;&#x8FDB;&#xFF0C;&#x89E3;&#x91CA;&#x5668;&#x662F;&#x4F1A;&#x62A5;&#x9519;&#x7684;&#xFF0C;&#x7F29;&#x8FDB;&#x95EE;&#x9898;&#x6709;&#x65F6;&#x5019;&#x641E;&#x75AF;&#x5F88;&#x591A;&#x4EBA;&#x3002;</p>
</li>
</ul>
<blockquote>
<p>[!question]</p>
<p>&#x90A3;&#x4E48;&#x5982;&#x4F55;&#x7F29;&#x8FDB;&#x5462;&#xFF1F;</p>
</blockquote>
<p>&#x6211;&#x4E2A;&#x4EBA;&#x4E00;&#x822C;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;<code>Tab</code>&#x952E;&#x7684;&#x5236;&#x8868;&#x7B26;&#x8DDD;&#x79BB;&#x8868;&#x793A;&#x7F29;&#x8FDB;&#x4E00;&#x5C42;&#xFF0C;&#x5982;&#x679C;&#x5C42;&#x7EA7;&#x5D4C;&#x5957;&#xFF0C;&#x6BD4;&#x5982;if&#x8BED;&#x53E5;&#x53EF;&#x4EE5;&#x5D4C;&#x5957;if&#x8BED;&#x53E5;&#xFF0C;&#x90A3;&#x4E48;&#x5C31;&#x6839;&#x636E;&#x5C42;&#x7EA7;&#x5173;&#x7CFB;&#x653E;&#x9002;&#x5F53;&#x6570;&#x91CF;&#x7684;Tab&#x8DDD;&#x79BB;&#x3002;&#x5F53;&#x7136;&#xFF0C;&#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x7528;&#x56DB;&#x4E2A;&#x7A7A;&#x683C;&#x952E;&#x6765;&#x7F29;&#x8FDB;&#xFF08;&#x4F60;&#x559C;&#x6B22;&#x4E24;&#x4E2A;&#x7A7A;&#x683C;&#x5176;&#x5B9E;&#x4E5F;&#x53EF;&#x4EE5;&#xFF0C;&#x4F46;&#x4E0D;&#x8981;&#x6709;&#x65F6;&#x5019;&#x7F29;&#x8FDB;&#x4E24;&#x4E2A;&#x7A7A;&#x683C;&#xFF0C;&#x6709;&#x65F6;&#x5019;&#x56DB;&#x4E2A;&#xFF09;&#x3002;&#x5B9E;&#x9645;&#x7F16;&#x5199;&#x4E2D;&#xFF0C;&#x5EFA;&#x8BAE;&#x7EDF;&#x4E00;&#x89C4;&#x8303;&#xFF0C;&#x662F;&#x7EDF;&#x4E00;&#x7A7A;&#x683C;&#x952E;&#x8FD8;&#x662F;Tab&#x952E;&#xFF0C;&#x6709;&#x65F6;&#x5019;&#x6DF7;&#x7740;&#x7528;&#x89E3;&#x91CA;&#x5668;&#x4E5F;&#x662F;&#x53EF;&#x80FD;&#x62A5;&#x9519;&#x7684;&#x3002;&#x4E00;&#x4E9B;&#x4E0D;&#x9519;&#x7684;IDE&#x53EF;&#x4EE5;&#x5B9E;&#x73B0;&#x4E00;&#x952E;&#x81EA;&#x52A8;&#x5E2E;&#x4F60;&#x8F6C;&#x6362;&#x6210;&#x5176;&#x4E2D;&#x4E00;&#x79CD;&#xFF0C;&#x5F88;&#x5C11;&#x6709;&#x8FD9;&#x6837;&#x7684;&#x56F0;&#x6270;&#xFF0C;&#x6BD4;&#x5982;<code>pycharm</code>&#x5C31;&#x80FD;&#x505A;&#x5230;&#x3002;</p>
<p>&#x6765;&#x4E00;&#x4E2A;&#x5D4C;&#x5957;&#x7684;&#x4F8B;&#x5B50;&#xFF1A;</p>
<pre class="language-"><code class="lang-python"><span class="token comment"># coding:utf-8</span>
a <span class="token operator">=</span> <span class="token number">10</span>
<span class="token keyword">if</span> a <span class="token operator">&gt;=</span> <span class="token number">5</span><span class="token punctuation">:</span>
    <span class="token keyword">if</span> a <span class="token operator">&gt;=</span> <span class="token number">8</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x5927;&#x4E8E;8&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">else</span><span class="token punctuation">:</span>
        <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x5927;&#x4E8E;&#x7B49;&#x4E8E;5&#x5C0F;&#x4E8E;8&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> a <span class="token operator">&lt;</span> <span class="token number">0</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x5C0F;&#x4E8E;0&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x4ECB;&#x4E8E;0&#x5230;5&#x4E4B;&#x95F4;&quot;</span><span class="token punctuation">)</span>
</code></pre>
<blockquote>
<p>[!danger]</p>
<p>&#x4E0D;&#x9700;&#x8981;&#x7F29;&#x8FDB;&#x7684;&#x5730;&#x65B9;&#x8BF7;&#x4E0D;&#x8981;&#x968F;&#x610F;&#x7F29;&#x8FDB;&#xFF0C;&#x6BD4;&#x5982;&#x4E00;&#x4E2A;&#x987A;&#x5E8F;&#x7ED3;&#x6784;&#xFF0C;&#x987A;&#x7740;&#x4E0B;&#x6765;&#x5C31;&#x884C;&#x4E86;&#xFF0C;&#x5C31;&#x6CA1;&#x5FC5;&#x8981;&#x7F29;&#x8FDB;&#x4E86;&#x3002;</p>
</blockquote>
<p>&#x6211;&#x4EEC;&#x6765;&#x770B;&#x70B9;&#x6CA1;&#x6709;&#x597D;&#x597D;&#x9075;&#x5FAA;&#x7F29;&#x8FDB;&#x539F;&#x5219;&#x6240;&#x9020;&#x6210;&#x95EE;&#x9898;&#x7684;&#x4F8B;&#x5B50;&#xFF08;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5B58;&#x5230;&#x4E00;&#x4E2A;py&#x6587;&#x4EF6;&#x4E2D;&#x6765;&#x8FD0;&#x884C;&#xFF09;&#xFF1A;</p>
<pre class="language-"><code class="lang-python"><span class="token comment"># coding:utf-8</span>
a <span class="token operator">=</span> <span class="token builtin">input</span><span class="token punctuation">(</span><span class="token string">&quot;&#x4F60;&#x7684;&#x8BED;&#x6587;&#x8003;&#x8BD5;&#x591A;&#x5C11;&#x5206;&#xFF1F;&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">if</span> <span class="token builtin">int</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span> <span class="token operator">&lt;</span> <span class="token number">90</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x6210;&#x7EE9;&#x4E0D;&#x8FC7;&#x5173;&#xFF0C;&#x7EE7;&#x7EED;&#x52AA;&#x529B;&#x54E6;~&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x54C7;&#x4F60;&#x771F;&#x68D2;&#x5440;&#xFF0C;&#x90FD;90&#x5206;&#x4EE5;&#x4E0A;&#x5566;&#xFF01;&quot;</span><span class="token punctuation">)</span>
</code></pre>
<p>&#x4E0A;&#x8FF0;&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x5982;&#x679C;&#x6211;&#x4EEC;&#x8F93;&#x5165;&#x4E00;&#x4E2A;90&#x5206;&#x4EE5;&#x4E0A;&#x7684;&#x5206;&#x6570;&#xFF0C;&#x5219;&#x8F93;&#x51FA;&#x7684;&#x7ED3;&#x679C;&#x5728;&#x903B;&#x8F91;&#x4E0A;&#x662F;&#x6CA1;&#x6709;&#x95EE;&#x9898;&#x7684;&#x3002;&#x4F46;&#x5F53;&#x6211;&#x4EEC;&#x8F93;&#x5165;&#x4E00;&#x4E2A;90&#x5206;&#x4EE5;&#x4E0B;&#x7684;&#x5206;&#x6570;&#x65F6;&#xFF0C;<code>print(&quot;&#x54C7;&#x4F60;&#x771F;&#x68D2;&#x5440;&#xFF0C;&#x90FD;90&#x5206;&#x4EE5;&#x4E0A;&#x5566;&#xFF01;&quot;)</code>&#x8FD9;&#x53E5;&#x4EE3;&#x7801;&#x4E5F;&#x88AB;&#x6267;&#x884C;&#x4E86;&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x6CA1;&#x6709;&#x7F29;&#x8FDB;&#xFF0C;&#x6CA1;&#x6709;&#x5728;if&#x5206;&#x652F;&#x7ED3;&#x6784;&#x4E2D;&#xFF0C;&#x662F;&#x65E0;&#x8BBA;&#x5982;&#x4F55;&#x90FD;&#x4F1A;&#x6267;&#x884C;&#x7684;&#x3002;</p>
<hr>
<h3 id="if&#x7ED3;&#x6784;&#x7684;&#x5224;&#x65AD;&#x6761;&#x4EF6;"><a name="if&#x7ED3;&#x6784;&#x7684;&#x5224;&#x65AD;&#x6761;&#x4EF6;" class="anchor-navigation-ex-anchor" href="#if&#x7ED3;&#x6784;&#x7684;&#x5224;&#x65AD;&#x6761;&#x4EF6;"><i class="fa fa-link" aria-hidden="true"></i></a>if&#x7ED3;&#x6784;&#x7684;&#x5224;&#x65AD;&#x6761;&#x4EF6;</h3>
<p>if&#x7ED3;&#x6784;&#x540E;&#x9762;&#x7684;&#x6761;&#x4EF6;&#x4E00;&#x5B9A;&#x8981;&#x662F;&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;&#x5417;&#xFF1F;&#x5176;&#x5B9E;&#x4E5F;&#x4E0D;&#x4E00;&#x5B9A;&#x7684;&#xFF0C;&#x5B83;&#x540E;&#x9762;&#x7684;&#x6761;&#x4EF6;&#x8FD8;&#x80FD;&#x8DDF;&#x5B57;&#x7B26;&#x4E32;&#x3001;&#x5217;&#x8868;&#x3001;&#x5143;&#x7EC4;&#x3001;&#x5B57;&#x5178;&#x7B49;&#x7B49;&#x4E1C;&#x897F;&#xFF0C;&#x8FD9;&#x4E9B;&#x4E1C;&#x897F;&#x4E5F;&#x80FD;&#x5224;&#x65AD;&#x51FA;True&#x6216;&#x8005;False&#x3002;</p>
<p>&#x4F60;&#x9700;&#x8981;&#x8BB0;&#x4F4F;&#x7684;&#x662F;&#x4E0B;&#x9762;&#x8FD9;&#x4E9B;&#xFF0C;&#x5B83;&#x4EEC;&#x5728;&#x8FDB;&#x884C;if&#x5224;&#x65AD;&#x7684;&#x65F6;&#x5019;&#x4F1A;&#x8FD4;&#x56DE;False&#xFF0C;&#x5176;&#x4ED6;&#x5747;&#x8FD4;&#x56DE;True&#x3002;&#x8FD9;&#x662F;if&#x8BED;&#x53E5;&#x5F88;&#x5BB9;&#x6613;&#x5224;&#x65AD;&#x8FD4;&#x56DE;&#x7684;&#x5185;&#x5BB9;&#x662F;&#x5426;&#x4E3A;&#x7A7A;&#x503C;&#x7684;<code>&#x795E;&#x5668;</code>&#xFF1A;</p>
<p><code>False&#x3001; None&#x3001; 0&#x3001; &quot;&quot;&#x3001; ()&#x3001; []&#x3001; {}</code></p>
<pre class="language-"><code class="lang-python"><span class="token comment"># coding:utf-8</span>
<span class="token comment"># &#x5176;&#x4ED6;&#x7684;&#x7C7B;&#x4F3C;&#xFF0C;&#x6211;&#x4EEC;&#x5C31;&#x4E0D;&#x4E00;&#x4E00;&#x5217;&#x4E3E;&#x4E86;&#xFF0C;&#x5927;&#x5BB6;&#x8BF7;&#x81EA;&#x5DF1;&#x5C1D;&#x8BD5;&#xFF0C;&#x8FD9;&#x91CC;&#x62FF;&#x7A7A;&#x5B57;&#x7B26;&#x4E32;&#x505A;&#x4F8B;&#x5B50;</span>
a <span class="token operator">=</span> <span class="token string">&quot;&quot;</span>
<span class="token keyword">if</span> a<span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;a&#x4E0D;&#x662F;&#x7A7A;&#x5B57;&#x7B26;&#x4E32;&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">else</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;a&#x4E3A;&#x7A7A;&#x5B57;&#x7B26;&#x4E32;&quot;</span><span class="token punctuation">)</span>
</code></pre>
<hr>
<h3 id="if&#x5206;&#x652F;&#x7684;&#x903B;&#x8F91;&#x9519;&#x8BEF;"><a name="if&#x5206;&#x652F;&#x7684;&#x903B;&#x8F91;&#x9519;&#x8BEF;" class="anchor-navigation-ex-anchor" href="#if&#x5206;&#x652F;&#x7684;&#x903B;&#x8F91;&#x9519;&#x8BEF;"><i class="fa fa-link" aria-hidden="true"></i></a>if&#x5206;&#x652F;&#x7684;&#x903B;&#x8F91;&#x9519;&#x8BEF;</h3>
<p>&#x4F7F;&#x7528;if&#x5206;&#x652F;&#x65F6;&#xFF0C;&#x6709;&#x65F6;&#x5019;&#x867D;&#x7136;&#x7A0B;&#x5E8F;&#x4E0D;&#x62A5;&#x9519;&#xFF0C;&#x4F46;&#x4EE3;&#x7801;&#x5374;&#x72AF;&#x4E86;&#x903B;&#x8F91;&#x9519;&#x8BEF;&#xFF08;&#x8FD9;&#x79CD;&#x9519;&#x8BEF;&#x662F;&#x4F60;&#x7684;&#x4EE3;&#x7801;&#x8FD0;&#x884C;&#x903B;&#x8F91;&#x8DDF;&#x4E1A;&#x52A1;&#x903B;&#x8F91;&#x6709;&#x5DEE;&#x5F02;&#xFF0C;&#x8FBE;&#x4E0D;&#x5230;&#x4F60;&#x60F3;&#x8981;&#x7684;&#x6548;&#x679C;&#xFF0C;&#x4F46;&#x5728;python&#x89E3;&#x91CA;&#x5668;&#x7684;&#x8BED;&#x6CD5;&#x4E0A;&#x662F;&#x8FC7;&#x5173;&#x7684;&#x53EF;&#x4EE5;&#x8FD0;&#x884C;&#x7684;&#x3002;&#x903B;&#x8F91;&#x9519;&#x8BEF;&#x662F;&#x6211;&#x4EEC;&#x7F16;&#x5199;&#x4EE3;&#x7801;&#x7684;&#x8FC7;&#x7A0B;&#x4E2D;&#x6BD4;&#x8F83;&#x96BE;&#x4EE5;&#x53D1;&#x73B0;&#x7684;&#x4E00;&#x79CD;&#x9519;&#x8BEF;&#xFF0C;&#x56E0;&#x4E3A;&#x89E3;&#x91CA;&#x5668;&#x4E0D;&#x4F1A;&#x62A5;&#x9519;&#x4F60;&#x80FD;&#x9A6C;&#x4E0A;&#x67E5;&#x95EE;&#x9898;&#xFF0C;&#x800C;&#x662F;&#x901A;&#x8FC7;&#x67E5;&#x770B;&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x6765;&#x5206;&#x6790;&#x7684;&#x65B9;&#x5F0F;&#x6765;&#x5224;&#x65AD;&#x6211;&#x4EEC;&#x5199;&#x7684;&#x662F;&#x5426;&#x6709;&#x95EE;&#x9898;&#xFF0C;&#x5B83;&#x5BF9;&#x4E8E;&#x7F16;&#x7A0B;&#x4EBA;&#x5458;&#x7684;&#x903B;&#x8F91;&#x601D;&#x7EF4;&#x3001;&#x7A7A;&#x95F4;&#x62BD;&#x8C61;&#x601D;&#x7EF4;&#x7684;&#x8981;&#x6C42;&#x8F83;&#x9AD8;&#x3002;&#x4F46;&#x5927;&#x5BB6;&#x4E0D;&#x8981;&#x6015;&#xFF0C;&#x9047;&#x5230;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4E00;&#x4E9B;IDE&#x8F6F;&#x4EF6;&#x7684;&#x8C03;&#x8BD5;&#x529F;&#x80FD;&#x6216;&#x8005;&#x5C06;&#x903B;&#x8F91;&#x62BD;&#x8C61;&#x51FA;&#x6765;&#x8FDB;&#x884C;&#x62BD;&#x4E1D;&#x5265;&#x8327;&#x5F0F;&#x7684;&#x5206;&#x6790;&#xFF0C;&#x662F;&#x53EF;&#x4EE5;&#x53D1;&#x73B0;&#x5E76;&#x89E3;&#x51B3;&#x95EE;&#x9898;&#x7684;&#xFF0C;&#x76F8;&#x4FE1;&#x4F60;&#x89E3;&#x51B3;&#x4E4B;&#x540E;&#x4E5F;&#x4F1A;&#x5F88;&#x6709;&#x6210;&#x5C31;&#x611F;&#xFF09;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x6CA1;&#x6709;&#x8FBE;&#x5230;&#x6211;&#x4EEC;&#x8981;&#x7684;&#x4E1A;&#x52A1;&#x6548;&#x679C;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x6765;&#x4E3E;&#x4E2A;&#x7B80;&#x5355;&#x7684;&#x4F8B;&#x5B50;&#xFF1A;</p>
<pre class="language-"><code class="lang-python"><span class="token comment"># coding:utf-8</span>
score <span class="token operator">=</span> <span class="token number">85</span>
<span class="token keyword">if</span> score <span class="token operator">&gt;</span> <span class="token number">60</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x53CA;&#x683C;&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> score <span class="token operator">&gt;</span> <span class="token number">80</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x826F;&#x597D;&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> score <span class="token operator">&gt;</span> <span class="token number">90</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x4F18;&#x79C0;&quot;</span><span class="token punctuation">)</span>
</code></pre>
<p>&#x6211;&#x4EEC;&#x6765;&#x770B;&#x4E0B;&#x4E0A;&#x9762;&#x7684;&#x4F8B;&#x5B50;&#xFF0C;&#x4E4D;&#x770B;&#x4E4B;&#x4E0B;&#x6211;&#x4EEC;&#x7684;&#x5224;&#x65AD;&#x6761;&#x4EF6;&#x90FD;&#x6CA1;&#x6709;&#x95EE;&#x9898;&#xFF0C;60&#x5206;&#x4EE5;&#x4E0A;&#x7684;&#x7B97;&#x53CA;&#x683C;&#xFF0C;80&#x5206;&#x4EE5;&#x4E0A;&#x7684;&#x7B97;&#x826F;&#x597D;&#xFF0C;90&#x5206;&#x4EE5;&#x4E0A;&#x7684;&#x7B97;&#x4F18;&#x79C0;&#x3002;&#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x7684;&#x6210;&#x7EE9;score&#x4E3A;85&#x5206;&#xFF0C;&#x600E;&#x4E48;&#x4E5F;&#x7B97;&#x826F;&#x597D;&#x8FD9;&#x4E00;&#x6863;&#xFF0C;&#x5BF9;&#x5427;&#xFF1F;</p>
<p>&#x6267;&#x884C;&#x4EE3;&#x7801;&#xFF0C;&#x6211;&#x4EEC;&#x53D1;&#x73B0;&#x7ED9;&#x6211;&#x4EEC;&#x8FD4;&#x56DE;&#x7684;&#x7ED3;&#x679C;&#x662F;&#xFF1A;<code>&quot;&#x53CA;&#x683C;&quot;</code></p>
<p>&#x54A6;&#xFF1F;&#x600E;&#x4E48;&#x4E0D;&#x662F;&#x826F;&#x597D;&#x5462;&#xFF1F;&#x5176;&#x5B9E;&#x5728;&#x8FD9;&#x91CC;&#x6211;&#x4EEC;&#x5C31;&#x72AF;&#x4E86;&#x4E00;&#x4E2A;&#x903B;&#x8F91;&#x9519;&#x8BEF;&#x3002;85&#x5206;&#x662F;&#x4E0D;&#x662F;&#x4E5F;&#x5927;&#x4E8E;60&#x5206;&#xFF1F;&#x662F;&#x7684;&#xFF0C;&#x6240;&#x4EE5;&#x5728;&#x6D41;&#x7A0B;&#x63A7;&#x5236;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x76F4;&#x63A5;&#x5C31;&#x4ECE;&#x53CA;&#x683C;&#x90A3;&#x91CC;&#x8DD1;&#x51FA;&#x6765;&#x4E86;&#xFF0C;&#x6839;&#x672C;&#x6CA1;&#x6709;&#x8FDB;&#x884C;&#x540E;&#x9762;&#x662F;&#x5426;&#x5927;&#x4E8E;80&#x5206;&#x7684;&#x5224;&#x65AD;&#x3002;</p>
<p>&#x8FD9;&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x7684;&#x903B;&#x8F91;&#x9519;&#x8BEF;&#xFF0C;&#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x5E94;&#x8BE5;&#x600E;&#x4E48;&#x4FEE;&#x6539;&#x5462;&#xFF1F;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x52A0;&#x4E0A;&#x8303;&#x56F4;&#x9650;&#x5236;&#x6761;&#x4EF6;&#xFF1A;</p>
<pre class="language-"><code class="lang-python"><span class="token comment"># coding:utf-8</span>
score <span class="token operator">=</span> <span class="token number">85</span>
<span class="token keyword">if</span> score <span class="token operator">&gt;</span> <span class="token number">60</span> <span class="token keyword">and</span> score <span class="token operator">&lt;=</span> <span class="token number">80</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x53CA;&#x683C;&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> score <span class="token operator">&gt;</span> <span class="token number">80</span> <span class="token keyword">and</span> score <span class="token operator">&lt;=</span> <span class="token number">90</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x826F;&#x597D;&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> score <span class="token operator">&gt;</span> <span class="token number">90</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x4F18;&#x79C0;&quot;</span><span class="token punctuation">)</span>
</code></pre>
<p>&#x901A;&#x8FC7;&#x8FD9;&#x6837;&#x7684;&#x4FEE;&#x6539;&#xFF0C;&#x6211;&#x4EEC;&#x5C31;&#x5B9E;&#x73B0;&#x4E86;&#x6BCF;&#x6BB5;&#x5224;&#x65AD;&#x7684;&#x8303;&#x56F4;&#x9650;&#x5B9A;&#xFF0C;&#x5C31;&#x80FD;&#x8F93;&#x51FA;<code>&#x826F;&#x597D;</code>&#x5566;&#x3002;</p>
<p>&#x6709;&#x7684;&#x540C;&#x5B66;&#x601D;&#x8DEF;&#x5F88;&#x5FEB;&#xFF0C;&#x80FD;&#x60F3;&#x51FA;&#x4E0B;&#x9762;&#x66F4;&#x597D;&#x7684;&#x529E;&#x6CD5;&#xFF1A;</p>
<pre class="language-"><code class="lang-python"><span class="token comment"># coding:utf-8</span>
score <span class="token operator">=</span> <span class="token number">85</span>
<span class="token keyword">if</span> score <span class="token operator">&gt;</span> <span class="token number">90</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x4F18;&#x79C0;&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> score <span class="token operator">&gt;</span> <span class="token number">80</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x826F;&#x597D;&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> score <span class="token operator">&gt;</span> <span class="token number">60</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x53CA;&#x683C;&quot;</span><span class="token punctuation">)</span>
</code></pre>
<p>&#x8FD9;&#x6BB5;&#x4EE3;&#x7801;&#x6CA1;&#x6709;&#x6DFB;&#x52A0;and&#xFF0C;&#x53EA;&#x662F;&#x8C03;&#x6362;&#x4E86;&#x4E00;&#x4E0B;&#x51E0;&#x4E2A;&#x5224;&#x65AD;&#x6761;&#x4EF6;&#x7684;&#x5199;&#x7684;&#x987A;&#x5E8F;&#xFF0C;&#x4E5F;&#x80FD;&#x5B9E;&#x73B0;&#x6211;&#x4EEC;&#x7684;&#x6548;&#x679C;&#xFF0C;&#x5206;&#x6790;&#x4E00;&#x4E0B;&#xFF0C;&#x65E2;&#x7136;&#x6211;&#x4EEC;&#x90FD;&#x662F;&#x5F80;&#x5927;&#x4E8E;&#x7684;&#x65B9;&#x5411;&#x8FDB;&#x884C;&#x5224;&#x65AD;&#xFF0C;&#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x5E94;&#x8BE5;&#x5148;&#x5224;&#x65AD;&#x6700;&#x5927;&#x7684;&#xFF0C;&#x5F53;90&#x4E0D;&#x6EE1;&#x8DB3;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x624D;&#x80FD;&#x5224;&#x65AD;&#x662F;&#x5426;&#x5927;&#x4E8E;80&#x8FD9;&#x4E00;&#x6863;&#xFF0C;&#x5728;&#x5224;&#x65AD;&#x8FD9;&#x4E00;&#x6863;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5DF2;&#x7ECF;&#x9690;&#x542B;&#x4E86;&#x4E00;&#x4E2A;&#x6761;&#x4EF6;&#xFF0C;&#x90A3;&#x5C31;&#x662F;&#x80AF;&#x5B9A;<code>&lt;= 90</code>&#xFF0C;&#x6240;&#x4EE5;&#x4E00;&#x5B9A;&#x4E0D;&#x53EF;&#x80FD;&#x662F;<code>&#x4F18;&#x79C0;</code>&#xFF0C;&#x8FD9;&#x65F6;&#x5019;&#x6211;&#x4EEC;&#x5C31;&#x4E0D;&#x4F1A;&#x9519;&#x6F0F;&#x4E86;&#x3002;</p>
<p>&#x901A;&#x8FC7;&#x4E0A;&#x8FF0;&#x51E0;&#x4E2A;&#x7B80;&#x5355;&#x4F8B;&#x5B50;&#x7684;&#x5B66;&#x4E60;&#xFF0C;&#x5927;&#x5BB6;&#x662F;&#x4E0D;&#x662F;&#x5BF9;&#x903B;&#x8F91;&#x9519;&#x8BEF;&#x6709;&#x4E86;&#x66F4;&#x52A0;&#x5F62;&#x8C61;&#x7684;&#x8BA4;&#x8BC6;&#xFF1F;&#x5728;&#x7F16;&#x5199;&#x4EE3;&#x7801;&#x65F6;&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x591A;&#x601D;&#x8003;&#x6D41;&#x7A0B;&#x63A7;&#x5236;&#x7684;&#x6700;&#x4F73;&#x903B;&#x8F91;&#xFF0C;&#x8FD9;&#x6837;&#x6709;&#x52A9;&#x4E8E;&#x8BAD;&#x7EC3;&#x6211;&#x4EEC;&#x7684;&#x7F16;&#x7A0B;&#x903B;&#x8F91;&#x601D;&#x7EF4;&#xFF0C;&#x5BF9;&#x5927;&#x5BB6;&#x662F;&#x5F88;&#x6709;&#x5E2E;&#x52A9;&#x7684;&#x3002;</p>
<hr>
<h3 id="if&#x8868;&#x8FBE;&#x5F0F;"><a name="if&#x8868;&#x8FBE;&#x5F0F;" class="anchor-navigation-ex-anchor" href="#if&#x8868;&#x8FBE;&#x5F0F;"><i class="fa fa-link" aria-hidden="true"></i></a>if&#x8868;&#x8FBE;&#x5F0F;</h3>
<p>&#x4E4B;&#x524D;&#x4ECB;&#x7ECD;&#x4E09;&#x76EE;&#x8FD0;&#x7B97;&#x7B26;&#x7684;&#x65F6;&#x5019;&#x4ECB;&#x7ECD;&#x8FC7;&#x4E00;&#x884C;&#x7684;if&#x8868;&#x8FBE;&#x5F0F;&#x5199;&#x6CD5;&#x3002;&#x8FD9;&#x91CC;&#x4E0D;&#x518D;&#x8D58;&#x8FF0;&#x3002;</p>
<p>&#x5F53;&#x6211;&#x4EEC;&#x53EA;&#x6709;if&#x5224;&#x65AD;&#x60F3;&#x8981;&#x5199;&#x5728;&#x4E00;&#x884C;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x8FD9;&#x4E48;&#x5199;&#xFF1A;</p>
<pre class="language-"><code class="lang-python"><span class="token comment"># coding:utf-8</span>
a <span class="token operator">=</span> <span class="token number">10</span>
<span class="token keyword">if</span> a <span class="token operator">&gt;</span> <span class="token number">5</span> <span class="token punctuation">:</span> <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x5927;&#x4E8E;5&quot;</span><span class="token punctuation">)</span>
</code></pre>
<hr>
<h3 id="pass&#x5360;&#x4F4D;&#x7B26;"><a name="pass&#x5360;&#x4F4D;&#x7B26;" class="anchor-navigation-ex-anchor" href="#pass&#x5360;&#x4F4D;&#x7B26;"><i class="fa fa-link" aria-hidden="true"></i></a>pass&#x5360;&#x4F4D;&#x7B26;</h3>
<p>pass&#x8868;&#x793A;&#x901A;&#x8FC7;&#x7684;&#x610F;&#x601D;&#xFF0C;&#x5728;python&#x4E2D;&#xFF0C;&#x5982;&#x679C;&#x6D41;&#x7A0B;&#x63A7;&#x5236;&#x7ED3;&#x6784;&#x540E;&#x9762;&#x7684;&#x4EE3;&#x7801;&#x6267;&#x884C;&#x4F53;&#xFF0C;&#x6211;&#x4EEC;&#x4E0D;&#x6253;&#x7B97;&#x6267;&#x884C;&#x4EFB;&#x4F55;&#x4EE3;&#x7801;&#x6216;&#x8005;&#x6253;&#x7B97;&#x4E0D;&#x8FDB;&#x884C;&#x4EFB;&#x4F55;&#x4EE3;&#x7801;&#x5904;&#x7406;&#xFF0C;&#x6216;&#x8005;&#x6211;&#x4EEC;&#x8FD8;&#x6CA1;&#x60F3;&#x597D;&#x8981;&#x6267;&#x884C;&#x5565;&#xFF0C;&#x90A3;&#x4E48;&#x5728;&#x7F16;&#x5199;&#x65F6;&#xFF0C;&#x4E0D;&#x80FD;&#x591F;&#x7559;&#x7A7A;&#xFF0C;&#x4F1A;&#x62A5;&#x9519;&#xFF0C;&#x8FD9;&#x65F6;&#x5019;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x7528;<code>pass</code>&#x6765;&#x4F5C;&#x4E3A;&#x6267;&#x884C;&#x4F53;&#x7684;&#x5360;&#x4F4D;&#x7B26;&#xFF0C;&#x4EE3;&#x7801;&#x8FD0;&#x884C;&#x5230;&#x8FD9;&#x91CC;&#x5C31;&#x4E0D;&#x6267;&#x884C;&#x4EFB;&#x4F55;&#x4EE3;&#x7801;&#x5F80;&#x4E0B;&#x4E86;&#x3002;</p>
<pre class="language-"><code class="lang-python"><span class="token comment"># coding:utf-8</span>
score <span class="token operator">=</span> <span class="token number">85</span>
<span class="token keyword">if</span> score <span class="token operator">&gt;</span> <span class="token number">90</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x4F18;&#x79C0;&quot;</span><span class="token punctuation">)</span>
<span class="token keyword">elif</span> score <span class="token operator">&gt;</span> <span class="token number">80</span><span class="token punctuation">:</span>
    <span class="token comment"># &#x8FD9;&#x91CC;&#x4E0D;&#x5199;&#x4EFB;&#x4F55;&#x53EF;&#x6267;&#x884C;&#x7684;&#x8BED;&#x53E5;&#xFF0C;&#x53EF;&#x4EE5;&#x5199;&#x4E2A;pass&#xFF0C;&#x5982;&#x679C;&#x6EE1;&#x8DB3;&#x6761;&#x4EF6;&#x8FDB;&#x6765;&#x4E86;&#xFF0C;&#x4E5F;&#x4E0D;&#x4F1A;&#x6267;&#x884C;&#x4EFB;&#x4F55;&#x4E1C;&#x897F;</span>
    <span class="token keyword">pass</span>
<span class="token keyword">elif</span> score <span class="token operator">&gt;</span> <span class="token number">60</span><span class="token punctuation">:</span>
    <span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string">&quot;&#x53CA;&#x683C;&quot;</span><span class="token punctuation">)</span>
</code></pre>
<h3 id="&#x5355;&#x8BCD;&#x91CA;&#x4E49;"><a name="&#x5355;&#x8BCD;&#x91CA;&#x4E49;" class="anchor-navigation-ex-anchor" href="#&#x5355;&#x8BCD;&#x91CA;&#x4E49;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5355;&#x8BCD;&#x91CA;&#x4E49;</h3>
<table>
<thead>
<tr>
<th>&#x5355;&#x8BCD;</th>
<th>&#x91CA;&#x4E49;</th>
</tr>
</thead>
<tbody>
<tr>
<td>if</td>
<td>&#x5982;&#x679C;</td>
</tr>
<tr>
<td>elif</td>
<td>else if&#x5408;&#x5728;&#x4E00;&#x8D77;&#x7684;&#x5199;&#x6CD5;&#xFF0C;&#x5176;&#x4ED6;&#x8BED;&#x8A00;&#x53EF;&#x80FD;&#x662F;&#x7528;&#x7684;else if&#x8FD9;&#x6837;&#x7684;&#xFF0C;python&#x6CE8;&#x610F;&#x7528;elif&#xFF0C;&#x8868;&#x793A;&#x5426;&#x5219;&#x5982;&#x679C;</td>
</tr>
<tr>
<td>else</td>
<td>&#x5426;&#x5219;</td>
</tr>
<tr>
<td>score</td>
<td>&#x6210;&#x7EE9;</td>
</tr>
<tr>
<td>pass</td>
<td>&#x901A;&#x8FC7;</td>
</tr>
</tbody>
</table>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; <a href="http://fox-9.com" target="_blank">&#x96EA;&#x5C71;&#x51CC;&#x72D0;&#x6559;&#x7A0B;</a> all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2020-04-11 17:11:29
</span></footer></body></html>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: 四、流程控制">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="4-2 python3小白课：while循环结构.html" class="navigation navigation-next " aria-label="Next page: 4-2 python3小白课：while循环结构">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"4-1 python3小白课：if分支结构","level":"1.6.1","depth":2,"next":{"title":"4-2 python3小白课：while循环结构","level":"1.6.2","depth":2,"path":"chapter4/4-2 python3小白课：while循环结构.md","ref":"./chapter4/4-2 python3小白课：while循环结构.md","articles":[]},"previous":{"title":"四、流程控制","level":"1.6","depth":1,"path":"chapter4/README.md","ref":"./chapter4/README.md","articles":[{"title":"4-1 python3小白课：if分支结构","level":"1.6.1","depth":2,"path":"chapter4/4-1 python3小白课：if分支结构.md","ref":"./chapter4/4-1 python3小白课：if分支结构.md","articles":[]},{"title":"4-2 python3小白课：while循环结构","level":"1.6.2","depth":2,"path":"chapter4/4-2 python3小白课：while循环结构.md","ref":"./chapter4/4-2 python3小白课：while循环结构.md","articles":[]},{"title":"4-3 python3小白课：for-in循环结构","level":"1.6.3","depth":2,"path":"chapter4/4-3 python3小白课：for-in循环结构.md","ref":"./chapter4/4-3 python3小白课：for-in循环结构.md","articles":[]},{"title":"4-4 python3小白课：for表达式","level":"1.6.4","depth":2,"path":"chapter4/4-4 python3小白课：for表达式.md","ref":"./chapter4/4-4 python3小白课：for表达式.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["favicon","-search","-lunr","-sharing","-livereload","-highlight","prism","prism-themes","fontsettings","back-to-top-button","expandable-chapters-small","code","search-pro","splitter","donate","tbfed-pagefooter","pageview-count","auto-scroll-table","lightbox","anchor-navigation-ex","sitemap-general","ad","image-captions","autotheme","advanced-emoji","flexible-alerts","statistics","push-bd"],"styles":{"website":"/css/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy <a href='http://fox-9.com'>雪山凌狐教程</a>","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-material-light.css"]},"ad":{"contentBottom":false},"statistics":{"bd_url":"https://hm.baidu.com/hm.js","cnzz_url":"https://s95.cnzz.com/z_stat.php","google_url":"https://www.googletagmanager.com/gtag/js","bd_token":"605d1993c133629d69ab2701f78d9690"},"splitter":{},"search-pro":{},"auto-scroll-table":{},"code":{"copyButtons":true},"donate":{"alipay":"/python3xiaobaike/assets/alipay-code.jpg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"/python3xiaobaike/assets/wechatpay-code.jpg","wechatText":"微信打赏"},"sitemap-general":{"prefix":"http://doc.fox-9.com/python3xiaobaike/"},"fontsettings":{"family":"sans","size":2,"theme":"white"},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"fa fa-hand-o-right","level2Icon":"fa fa-hand-o-right","level3Icon":"fa fa-hand-o-right","showLevelIcon":true},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":false,"showLevel":false},"favicon":{"shortcut":"/assets/favicon.ico","bookmark":"/assets/favicon.ico"},"lightbox":{"jquery":true,"sameUuid":false},"push-bd":{},"back-to-top-button":{},"pageview-count":{},"prism-themes":{},"expandable-chapters-small":{},"flexible-alerts":{"danger":{"className":"danger","icon":"fa fa-ban","label":"注意"},"note":{"className":"info","icon":"fa fa-info-circle","label":"说明"},"style":"flat","tip":{"className":"tip","icon":"fa fa-lightbulb-o","label":"提示"},"warning":{"className":"warning","icon":"fa fa-exclamation-triangle","label":"警告"},"question":{"label":"问题","icon":"fa fa-question-circle","className":"question"}},"autotheme":{"night":[20,21,22,23,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],"sepia":[25,25,25,25,25,25],"white":[25,25,25,25,25,25,25,25]},"advanced-emoji":{"embedEmojis":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"image-captions":{"caption":"_CAPTION_","variable_name":"_pictures"}},"theme":"default","author":"雪山凌狐","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"CATALOG_FOR_GITBOOK.md"},"variables":{"_pictures":[{"backlink":"./chapter1/1-1 python3小白课：python语言简介.html#fig1.3.1.1","level":"1.3.1","list_caption":"Figure: 图1-1-1 龟叔","alt":"图1-1-1 龟叔","nro":1,"url":"assets/1-1-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图1-1-1 龟叔","attributes":{},"skip":false,"key":"1.3.1.1"},{"backlink":"./chapter1/1-1 python3小白课：python语言简介.html#fig1.3.1.2","level":"1.3.1","list_caption":"Figure: 图1-1-2 python2的最后一个版本官方博客","alt":"图1-1-2 python2的最后一个版本官方博客","nro":2,"url":"assets/1-1-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图1-1-2 python2的最后一个版本官方博客","attributes":{},"skip":false,"key":"1.3.1.2"},{"backlink":"./chapter1/1-2 python3小白课：python下载.html#fig1.3.2.1","level":"1.3.2","list_caption":"Figure: 图1-2-1 python官网界面","alt":"图1-2-1 python官网界面","nro":3,"url":"assets/1-2-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图1-2-1 python官网界面","attributes":{},"skip":false,"key":"1.3.2.1"},{"backlink":"./chapter1/1-2 python3小白课：python下载.html#fig1.3.2.2","level":"1.3.2","list_caption":"Figure: 图1-2-2 python3.8.2版本安装包","alt":"图1-2-2 python3.8.2版本安装包","nro":4,"url":"assets/1-2-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图1-2-2 python3.8.2版本安装包","attributes":{},"skip":false,"key":"1.3.2.2"},{"backlink":"./chapter1/1-3 python3小白课：python安装.html#fig1.3.3.1","level":"1.3.3","list_caption":"Figure: 图1-3-1 安装界面1","alt":"图1-3-1 安装界面1","nro":5,"url":"assets/1-3-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图1-3-1 安装界面1","attributes":{},"skip":false,"key":"1.3.3.1"},{"backlink":"./chapter1/1-3 python3小白课：python安装.html#fig1.3.3.2","level":"1.3.3","list_caption":"Figure: 图1-3-2 安装界面2","alt":"图1-3-2 安装界面2","nro":6,"url":"assets/1-3-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图1-3-2 安装界面2","attributes":{},"skip":false,"key":"1.3.3.2"},{"backlink":"./chapter1/1-3 python3小白课：python安装.html#fig1.3.3.3","level":"1.3.3","list_caption":"Figure: 图1-3-3 安装界面3","alt":"图1-3-3 安装界面3","nro":7,"url":"assets/1-3-3.jpg","index":3,"caption_template":"_CAPTION_","label":"图1-3-3 安装界面3","attributes":{},"skip":false,"key":"1.3.3.3"},{"backlink":"./chapter1/1-6 python3小白课：使用python IDLE.html#fig1.3.6.1","level":"1.3.6","list_caption":"Figure: 图1-6-1 python shell","alt":"图1-6-1 python shell","nro":8,"url":"assets/1-6-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图1-6-1 python shell","attributes":{},"skip":false,"key":"1.3.6.1"},{"backlink":"./chapter1/1-6 python3小白课：使用python IDLE.html#fig1.3.6.2","level":"1.3.6","list_caption":"Figure: 图1-6-2 python IDLE写py文件","alt":"图1-6-2 python IDLE写py文件","nro":9,"url":"assets/1-6-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图1-6-2 python IDLE写py文件","attributes":{},"skip":false,"key":"1.3.6.2"},{"backlink":"./chapter1/1-7 python3小白课：使用python shell.html#fig1.3.7.1","level":"1.3.7","list_caption":"Figure: 图1-7-1 进入python shell","alt":"图1-7-1 进入python shell","nro":10,"url":"assets/1-7-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图1-7-1 进入python shell","attributes":{},"skip":false,"key":"1.3.7.1"},{"backlink":"./chapter1/1-7 python3小白课：使用python shell.html#fig1.3.7.2","level":"1.3.7","list_caption":"Figure: 图1-7-2 python shell代码测试","alt":"图1-7-2 python shell代码测试","nro":11,"url":"assets/1-7-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图1-7-2 python shell代码测试","attributes":{},"skip":false,"key":"1.3.7.2"},{"backlink":"./chapter6/6-8 python3小白课：解锁你心仪的三方包.html#fig1.8.8.1","level":"1.8.8","list_caption":"Figure: 图6-8-1 pypi官网首页","alt":"图6-8-1 pypi官网首页","nro":12,"url":"assets/6-8-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图6-8-1 pypi官网首页","attributes":{},"skip":false,"key":"1.8.8.1"},{"backlink":"./chapter6/6-8 python3小白课：解锁你心仪的三方包.html#fig1.8.8.2","level":"1.8.8","list_caption":"Figure: 图6-8-2 requests搜索结果","alt":"图6-8-2 requests搜索结果","nro":13,"url":"assets/6-8-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图6-8-2 requests搜索结果","attributes":{},"skip":false,"key":"1.8.8.2"},{"backlink":"./chapter6/6-8 python3小白课：解锁你心仪的三方包.html#fig1.8.8.3","level":"1.8.8","list_caption":"Figure: 图6-8-3 包的内页","alt":"图6-8-3 包的内页","nro":14,"url":"assets/6-8-3.jpg","index":3,"caption_template":"_CAPTION_","label":"图6-8-3 包的内页","attributes":{},"skip":false,"key":"1.8.8.3"},{"backlink":"./chapter6/6-8 python3小白课：解锁你心仪的三方包.html#fig1.8.8.4","level":"1.8.8","list_caption":"Figure: 图6-8-4 下载文件页面","alt":"图6-8-4 下载文件页面","nro":15,"url":"assets/6-8-4.jpg","index":4,"caption_template":"_CAPTION_","label":"图6-8-4 下载文件页面","attributes":{},"skip":false,"key":"1.8.8.4"},{"backlink":"./chapter6/6-9 python3小白课：虚拟环境介绍和安装.html#fig1.8.9.1","level":"1.8.9","list_caption":"Figure: 图6-9-1 新建系统环境变量WORKON_HOME","alt":"图6-9-1 新建系统环境变量WORKON_HOME","nro":16,"url":"assets/6-9-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图6-9-1 新建系统环境变量WORKON_HOME","attributes":{},"skip":false,"key":"1.8.9.1"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.1","level":"1.8.10","list_caption":"Figure: 图6-10-1 创建test虚拟环境","alt":"图6-10-1 创建test虚拟环境","nro":17,"url":"assets/6-10-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图6-10-1 创建test虚拟环境","attributes":{},"skip":false,"key":"1.8.10.1"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.2","level":"1.8.10","list_caption":"Figure: 图6-10-2 退出虚拟环境","alt":"图6-10-2 退出虚拟环境","nro":18,"url":"assets/6-10-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图6-10-2 退出虚拟环境","attributes":{},"skip":false,"key":"1.8.10.2"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.3","level":"1.8.10","list_caption":"Figure: 图6-10-3 workon激活虚拟环境test","alt":"图6-10-3 workon激活虚拟环境test","nro":19,"url":"assets/6-10-3.jpg","index":3,"caption_template":"_CAPTION_","label":"图6-10-3 workon激活虚拟环境test","attributes":{},"skip":false,"key":"1.8.10.3"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.4","level":"1.8.10","list_caption":"Figure: 图6-10-4 虚拟环境下的pip","alt":"图6-10-4 虚拟环境下的pip","nro":20,"url":"assets/6-10-4.jpg","index":4,"caption_template":"_CAPTION_","label":"图6-10-4 虚拟环境下的pip","attributes":{},"skip":false,"key":"1.8.10.4"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.5","level":"1.8.10","list_caption":"Figure: 图6-10-5 删除虚拟环境test","alt":"图6-10-5 删除虚拟环境test","nro":21,"url":"assets/6-10-5.jpg","index":5,"caption_template":"_CAPTION_","label":"图6-10-5 删除虚拟环境test","attributes":{},"skip":false,"key":"1.8.10.5"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.6","level":"1.8.10","list_caption":"Figure: 图6-10-6 python3.6.6安装","alt":"图6-10-6 python3.6.6安装","nro":22,"url":"assets/6-10-6.jpg","index":6,"caption_template":"_CAPTION_","label":"图6-10-6 python3.6.6安装","attributes":{},"skip":false,"key":"1.8.10.6"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.7","level":"1.8.10","list_caption":"Figure: 图6-10-7 创建python3.6.6的虚拟环境","alt":"图6-10-7 创建python3.6.6的虚拟环境","nro":23,"url":"assets/6-10-7.jpg","index":7,"caption_template":"_CAPTION_","label":"图6-10-7 创建python3.6.6的虚拟环境","attributes":{},"skip":false,"key":"1.8.10.7"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.8","level":"1.8.10","list_caption":"Figure: 图6-10-8 python2.7.18安装","alt":"图6-10-8 python2.7.18安装","nro":24,"url":"assets/6-10-8.jpg","index":8,"caption_template":"_CAPTION_","label":"图6-10-8 python2.7.18安装","attributes":{},"skip":false,"key":"1.8.10.8"},{"backlink":"./chapter6/6-10 python3小白课：虚拟环境使用.html#fig1.8.10.9","level":"1.8.10","list_caption":"Figure: 图6-10-9 创建python2.7.18的虚拟环境","alt":"图6-10-9 创建python2.7.18的虚拟环境","nro":25,"url":"assets/6-10-9.jpg","index":9,"caption_template":"_CAPTION_","label":"图6-10-9 创建python2.7.18的虚拟环境","attributes":{},"skip":false,"key":"1.8.10.9"},{"backlink":"./chapter7/7-1 python3小白课：一节课搞懂面向对象.html#fig1.9.1.1","level":"1.9.1","list_caption":"Figure: 图7-1-1 暖风机","alt":"图7-1-1 暖风机","nro":26,"url":"assets/7-1-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图7-1-1 暖风机","attributes":{},"skip":false,"key":"1.9.1.1"},{"backlink":"./chapter7/7-1 python3小白课：一节课搞懂面向对象.html#fig1.9.1.2","level":"1.9.1","list_caption":"Figure: 图7-1-2 会摇头的暖风机","alt":"图7-1-2 会摇头的暖风机","nro":27,"url":"assets/7-1-2.jpg","index":2,"caption_template":"_CAPTION_","label":"图7-1-2 会摇头的暖风机","attributes":{},"skip":false,"key":"1.9.1.2"},{"backlink":"./chapter7/7-1 python3小白课：一节课搞懂面向对象.html#fig1.9.1.3","level":"1.9.1","list_caption":"Figure: 图7-1-3 会摇头的冷风机","alt":"图7-1-3 会摇头的冷风机","nro":28,"url":"assets/7-1-3.jpg","index":3,"caption_template":"_CAPTION_","label":"图7-1-3 会摇头的冷风机","attributes":{},"skip":false,"key":"1.9.1.3"},{"backlink":"./chapter7/7-7 python3小白课：重写父类方法和使用super函数.html#fig1.9.7.1","level":"1.9.7","list_caption":"Figure: 图7-7-1 鸡的图片","alt":"图7-7-1 鸡的图片","nro":29,"url":"assets/7-7-1.jpg","index":1,"caption_template":"_CAPTION_","label":"图7-7-1 鸡的图片","attributes":{},"skip":false,"key":"1.9.7.1"}]},"title":"python3小白课笔记","language":"zh-hans","links":{"sidebar":{"雪山凌狐教程":"http://fox-9.com"}},"gitbook":"3.2.3","description":"python3小白课，让你不再惧怕python的入门学习"},"file":{"path":"chapter4/4-1 python3小白课：if分支结构.md","mtime":"2020-04-11T09:11:29.883Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-09-14T10:02:56.416Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-auto-scroll-table/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-ad/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-autotheme/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-statistics/statistics.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-push-bd/plugin.js"></script>
        
    

    </body>
</html>

